<?php

//every 1 min rate limit
Route::namespace('Api')->prefix('sms')->group(function (\Illuminate\Routing\Router $api) {
    $api->get('send', 'SmsController@send')->name('sendSmsCode');
});

Route::namespace('Api')->prefix('user')->group(function (\Illuminate\Routing\Router $api) {
    $api->get('login', 'UserController@login')->name('userLogin');
    $api->post('register','UserController@register')->name('register');
    $api->post('logout', 'UserController@logout')->middleware(['jwt'])->name('logout');
    $api->post('reset_password','UserController@reset_password')->name('reset_password');
    $api->get('queryStatus','UserController@queryUser')->middleware(['jwt'])->name('queryStatus');

});

Route::group(['prefix' => 'card', 'namespace' => 'Api', 'middleware' => ['jwt']], function (\Illuminate\Routing\Router $api) {
    $api->get('lists', 'CardsController@lists')->name('cardList'); //列表
    $api->post('bind', 'CardsController@bind')->name('bindCard'); //绑定
    $api->post('confirm', 'CardsController@confirm')->name('confirm'); //确认绑定
    $api->post('resendSmsCode', 'CardsController@resendSmsCode')->name('resendSmsCode'); //重新发送验证码
    $api->post('addcus','CardsController@addcus')->name('addcus');//商户进件
    $api->post('unbind','CardsController@unbind')->name('unbind');//解绑
});

Route::group(['prefix' => 'product', 'namespace' => 'Api', 'middleware' => 'jwt.auth'], function (\Illuminate\Routing\Router $api) {

});

Route::group(['namespace' => 'Api'], function (\Illuminate\Routing\Router $api) {
    $api->post('notify', 'NotifyController@handle')->name('notify'); //订单异步回调处理
    $api->get('queryBalance','PayController@queryBalance')->middleware(['jwt'])->name('queryBalance');//查询余额
    $api->post('quickpass','PayController@quickpass')->middleware(['jwt'])->name('quickpass');//快捷支付
    $api->post('updatesettinfo','PayController@updatesettinfo')->middleware(['jwt'])->name('updatesettinfo');//修改费率
    $api->post('withdraw','PayController@withdraw')->middleware(['jwt'])->name('withdraw');//修改费率

    $api->get('banners','ConfigController@banners')->name('getBanners');
    $api->get('appversion','ConfigController@appUpdate')->name('appUpdate');
});



Route::group(['prefix' => 'order', 'namespace' => 'Api', 'middleware' => ['jwt']], function (\Illuminate\Routing\Router $api) {
    $api->post('create','OrderController@create')->name('createOrder');//创建订单
    $api->get('lists','OrderController@orderLists')->name('orderLists');
    $api->get('details','OrderController@orderDetails')->name('orderDetail');
    $api->get('confirm','OrderController@confirm')->name('confirmOrder');
    $api->get('cancel','OrderController@cancel')->name('cancelOrder');
    
});



